ARMA / ARIMA / SARIMA Models
In this section, we examine the applicability of AutoRegressive Moving Average (ARMA), AutoRegressive Integrated Moving Average (ARIMA), and Seasonal AutoRegressive Integrated Moving Average (SARIMA) models.
Using the time series obtained in the previous section, Exploratory Data Analysis section, this section is dedicated to the application of the methods to obtain an appropriate forecasting model for each one. These methods include the Augmented Dickey-Fuller test, the Autocorrelation Function (ACF), and the Partial Autocorrelation Function (PACF), to identify time dependencies and correlations.
After successfully transforming the data into a stationary time series, we apply time series functions within the R programming environment and other plotting methods to develop the analysis. These include the Arima() function for model fitting, parameter selection based on the stationary time series PACF plots, differencing methods, and ACF plots. Akaike Information Criterion (AIC) minimization, Bayesian Information Criterion (BIC) minimization, and holistic model diagnostics were used to successfully select models.
The selected model is subjected to holistic model diagnostics and residual analysis for further understanding and model validation, which allows to create forecasting on the time series.
Below are the libraries used in this section:
Libraries
library(tidyverse)
library(ggplot2)
library(forecast)
library(astsa)
library(xts)
library(tseries)
library(fpp2)
library(fma)
library(lubridate)
library(tidyverse)
library(TSstudio)
library(quantmod)
library(tidyquant)
library(plotly)
library(ggplot2)
library(gridExtra)
library(readxl)
library(imputeTS)Oil Price by Month
In the dedicated section ARIMA Model | Oil Price, an ARIMA(1,1,1) model was meticulously constructed to predict monthly oil prices. The visualization below shows that the forecasts produced a stable result, suggesting a stable trajectory for oil prices. This prediction is of considerable importance, especially in contrast to the significant fluctuations observed in recent years. Maintaining a stable oil price can alleviate concerns about rising production costs for various manufacturing industries, which often respond to an upward trend in oil prices.
U.S. Oil Production by Month
Detailed in the ARIMA Model | Oil Production section, our construction of an ARIMA(2,1,2) model aimed to predict monthly oil production. The visualization below shows forecasts with minimal variability, signifying a steady path for oil production. This prediction gains importance, especially in light of the post-COVID recovery trend observed in recent years. The stability of oil production levels is critical, as it affects the supply chain on which various industries, including manufacturing and transportation, rely heavily, and potentially impacts national gas prices.
Bus Transport
We did a first SARIMA Model | Bus Passengers Pre COVID analysis where we obtained a forecast that represents the predicted values if COVID wouldn’t exist.
Second we did a SARIMA Model | Bus Passengers Complete analysis where we obtained a real prediction of the values.
The first plot shown is the Forecast for the Pre COVID analysis done with a SARIMA(2,1,0)(1,1,1)[12] model. The second plot shown is the Forecast for the complete analysis done with a SARIMA(0,1,0)(0,1,1)[12] model.
We can clearly see the difference between the forecasts. Both contain the seasonal effect by the first one tends to have and upward trend while the second one shows a downward trend.